load("//rs/tests:common.bzl", "GRAFANA_RUNTIME_DEPS", "NNS_CANISTER_ENV", "NNS_CANISTER_RUNTIME_DEPS", "SNS_CANISTER_ENV", "SNS_CANISTER_RUNTIME_DEPS")
load("//rs/tests:system_tests.bzl", "system_test")

package(default_visibility = ["//rs:system-tests-pkg"])

system_test(
    name = "sns_sale_load_test_1",
    env = NNS_CANISTER_ENV | SNS_CANISTER_ENV,
    tags = [
        "manual",
    ],
    test_timeout = "eternal",
    runtime_deps = NNS_CANISTER_RUNTIME_DEPS +
                   SNS_CANISTER_RUNTIME_DEPS + GRAFANA_RUNTIME_DEPS,
    deps = [
        "//rs/tests/driver:ic-system-test-driver",
        "//rs/tests/nns/sns/lib:sns_system_test_lib",
        "@crate_index//:anyhow",
    ],
)

system_test(
    name = "sns_sale_load_test_2",
    env = NNS_CANISTER_ENV | SNS_CANISTER_ENV,
    tags = [
        "manual",
    ],
    test_timeout = "eternal",
    runtime_deps = NNS_CANISTER_RUNTIME_DEPS +
                   SNS_CANISTER_RUNTIME_DEPS + GRAFANA_RUNTIME_DEPS,
    deps = [
        "//rs/tests/driver:ic-system-test-driver",
        "//rs/tests/nns/sns/lib:sns_system_test_lib",
        "@crate_index//:anyhow",
    ],
)

system_test(
    name = "sns_sale_load_test_3",
    env = NNS_CANISTER_ENV | SNS_CANISTER_ENV,
    tags = [
        "manual",
    ],
    test_timeout = "eternal",
    runtime_deps = NNS_CANISTER_RUNTIME_DEPS +
                   SNS_CANISTER_RUNTIME_DEPS + GRAFANA_RUNTIME_DEPS,
    deps = [
        "//rs/tests/driver:ic-system-test-driver",
        "//rs/tests/nns/sns/lib:sns_system_test_lib",
        "@crate_index//:anyhow",
    ],
)

system_test(
    name = "aggregation_canister_test",
    env = NNS_CANISTER_ENV | SNS_CANISTER_ENV | {
        "SNS_AGGREGATOR_WASM_PATH": "$(rootpath @sns_aggregator//file)",
    },
    # TODO[NNS1-2658]: re-enable this test
    tags = [
        "manual",
    ],
    runtime_deps = NNS_CANISTER_RUNTIME_DEPS +
                   SNS_CANISTER_RUNTIME_DEPS + GRAFANA_RUNTIME_DEPS + [
        "@sns_aggregator//file",
    ],
    deps = [
        "//rs/tests/driver:ic-system-test-driver",
        "//rs/tests/nns/sns/lib:sns_system_test_lib",
        "@crate_index//:anyhow",
    ],
)

system_test(
    name = "workload_static_testnet",
    env = NNS_CANISTER_ENV | SNS_CANISTER_ENV,
    tags = [
        "manual",
    ],
    test_timeout = "eternal",
    runtime_deps = NNS_CANISTER_RUNTIME_DEPS +
                   SNS_CANISTER_RUNTIME_DEPS + GRAFANA_RUNTIME_DEPS,
    deps = [
        "//rs/tests/driver:ic-system-test-driver",
        "//rs/tests/nns/sns/lib:sns_system_test_lib",
        "@crate_index//:anyhow",
        "@crate_index//:slog",
    ],
)

system_test(
    name = "launchpad_direct_load_test",
    env = NNS_CANISTER_ENV | SNS_CANISTER_ENV | {
        "SNS_AGGREGATOR_WASM_PATH": "$(rootpath @sns_aggregator//file)",
    },
    tags = [
        "manual",
    ],
    test_timeout = "eternal",
    runtime_deps = NNS_CANISTER_RUNTIME_DEPS +
                   SNS_CANISTER_RUNTIME_DEPS + GRAFANA_RUNTIME_DEPS + [
        "@sns_aggregator//file",
    ],
    deps = [
        "//rs/tests/driver:ic-system-test-driver",
        "//rs/tests/nns/sns/lib:sns_system_test_lib",
        "@crate_index//:anyhow",
    ],
)

system_test(
    name = "launchpad_direct_auth_load_test",
    env = NNS_CANISTER_ENV | SNS_CANISTER_ENV | {
        "SNS_AGGREGATOR_WASM_PATH": "$(rootpath @sns_aggregator//file)",
    },
    tags = [
        "manual",
    ],
    test_timeout = "eternal",
    runtime_deps = NNS_CANISTER_RUNTIME_DEPS +
                   SNS_CANISTER_RUNTIME_DEPS + GRAFANA_RUNTIME_DEPS + [
        "@sns_aggregator//file",
    ],
    deps = [
        "//rs/tests/driver:ic-system-test-driver",
        "//rs/tests/nns/sns/lib:sns_system_test_lib",
        "@crate_index//:anyhow",
    ],
)

system_test(
    name = "launchpad_aggregator_load_test",
    env = NNS_CANISTER_ENV | SNS_CANISTER_ENV | {
        "SNS_AGGREGATOR_WASM_PATH": "$(rootpath @sns_aggregator//file)",
    },
    tags = [
        "manual",
    ],
    test_timeout = "eternal",
    runtime_deps = NNS_CANISTER_RUNTIME_DEPS +
                   SNS_CANISTER_RUNTIME_DEPS + GRAFANA_RUNTIME_DEPS + [
        "@sns_aggregator//file",
    ],
    deps = [
        "//rs/tests/driver:ic-system-test-driver",
        "//rs/tests/nns/sns/lib:sns_system_test_lib",
        "@crate_index//:anyhow",
    ],
)

system_test(
    name = "payment_flow_load_test",
    env = NNS_CANISTER_ENV | SNS_CANISTER_ENV,
    tags = [
        "manual",
    ],
    test_timeout = "eternal",  # TODO: consider removing this
    runtime_deps = NNS_CANISTER_RUNTIME_DEPS +
                   SNS_CANISTER_RUNTIME_DEPS + GRAFANA_RUNTIME_DEPS,
    deps = [
        "//rs/tests/driver:ic-system-test-driver",
        "//rs/tests/nns/sns/lib:sns_system_test_lib",
        "@crate_index//:anyhow",
    ],
)
